Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor OpenReac optimization tests #83

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open

Conversation

p-arvy
Copy link
Member

@p-arvy p-arvy commented Nov 27, 2024

Please check if the PR fulfills these requirements

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

Does this PR already have an issue describing the problem?

No.

What kind of change does this PR introduce?

The optimization tests of OpenReac are refactored.

What is the current behavior?

All the tests are in the same file.

What is the new behavior (if this is a feature change)?
The tests have been divided into several files.
This will facilitate the adding of new tests in the future.

Does this PR introduce a breaking change or deprecate an API?

  • Yes
  • No

If yes, please check if the following requirements are fulfilled

  • The Breaking Change or Deprecated label has been added
  • The migration steps are described in the following section

What changes might users need to make in their application due to this PR? (migration steps)

Other information:

Signed-off-by: p-arvy <pierre.arvy@artelys.com>
Signed-off-by: p-arvy <pierre.arvy@artelys.com>
Signed-off-by: p-arvy <pierre.arvy@artelys.com>
Signed-off-by: p-arvy <pierre.arvy@artelys.com>
Signed-off-by: p-arvy <pierre.arvy@artelys.com>
Signed-off-by: p-arvy <pierre.arvy@artelys.com>
Signed-off-by: p-arvy <pierre.arvy@artelys.com>
Signed-off-by: p-arvy <pierre.arvy@artelys.com>
Signed-off-by: p-arvy <pierre.arvy@artelys.com>
@p-arvy p-arvy changed the title [WIP] Refactor OpenReac optimization tests Refactor OpenReac optimization tests Dec 12, 2024
@p-arvy p-arvy requested a review from So-Fras December 19, 2024 09:39
@p-arvy p-arvy added the Java label Dec 19, 2024
@p-arvy p-arvy self-assigned this Dec 19, 2024
Copy link
Member

@So-Fras So-Fras left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for refactoring the tests!

/**
* Runs OpenReac and apply the results on the network.
*/
void runAndApplyAllModifications(Network network, String subFolder, OpenReacParameters parameters,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not adding the protected keyword here?

* Add voltage limits to voltage levels with undefined limits.
* OpenReac needs voltage limits to run optimization.
*/
void setDefaultVoltageLimits(Network network) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same remark, why not adding the protected keyword?

assertEquals(-4.698, network.getBusBreakerView().getBus("BUS_3").getAngle(), 0.001);
}

public static Network create() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason why the method is public?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is a bit confusing that this method is named the same than another one in ShuntNetworkFactory (also used in tests).

So maybe change the public into a private and change the name into a more explicit one?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants